package com.example.servicegateway;

import com.example.servicegateway.config.SpringHintLoadBalancerConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClients;

/**
 * Spring Cloud Gateway集成Sentinel：https://blog.csdn.net/plgy_Y/article/details/100316177
 *
 * 启动参数：-Dcsp.sentinel.app.type=1
 * 测试链接：http://localhost:8764/service-luna/started/hi?name=forezp
 *
 * LoadBalancerClients有两个灰度负载均衡器
 * @author K
 */

@EnableConfigurationProperties
@EnableDiscoveryClient
@SpringBootApplication
//@LoadBalancerClients(defaultConfiguration = GrayLoadBalancerConfig.class)
@LoadBalancerClients(defaultConfiguration = SpringHintLoadBalancerConfiguration.class)
public class ServiceGatewayApplication {

    public static void main(String[] args) {
        SpringApplication.run(ServiceGatewayApplication.class, args);
    }
}
